import ajax from './ajax'

export default {

  loadProjects(onSuccess) {
    ajax.get('/douban/projects')
        .then(onSuccess);
  },

  loadOne(id, onSuccess) {
    ajax.get('/douban/projects/' + id)
        .then(onSuccess);
  },

  saveProject(model, onSuccess, onError) {
    ajax.post('/douban/projects', model)
        .then(onSuccess)
        .catch(onError);
  }

};